export const chat = async (question,mode)=> {
    try {
        const response = await fetch("http://localhost:3001/api/v1/workspace/for_study/chat", {
            method: "POST",
            headers: {
                "accept": "application/json",
                "Authorization": "Bearer MGTV01G-6S74CEQ-HX3EGE7-1V9N7RD",
                "Content-Type": "application/json"
            },
            body: JSON.stringify({
                "message": question,
                "mode": mode
            })
        });
        const data = await response.json();
        console.log(data);
        return data.textResponse;
    } catch (error) {
        console.error("请求出错:", error);
    }
}